/*
 * @Author: your name
 * @Date: 2021-12-17 11:08:29
 * @LastEditTime: 2022-02-14 13:38:13
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \operation-management-systems\src\api\task-manage\agricultural-work\index.js
 */
/*
 * @Description: 农事作业信息管理接口
 */
import xjaxios from "@/api/axios";
import xjoaxios from "@/api/axios";

export default {
  /**
   * @description: 获取设备名称列表 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
   */
  // 分页查询获取列表信息
  // total中将这个公司级别id带上
  getPageList(params) {
    return xjoaxios.post(`/agriculturalTask/queryPageList`, params);
  },

  /**
   * @description: 批量获取批次类型
   * @param {Object} params *
   * @return {Object}
   */

  getbatchList() {
    return xjoaxios.post(`/batch/queryByCondition`, {});
  },
  // 获取某个批次的详细信息
  getbatchfaclist(id) {
    return xjoaxios.get(`/batch/query/${id}`)
  },
  /**
   * @description: 获取设施名称
   * @param {Object} params *
   * @return {Object}
   */
  // getfacilityList() {
  //   return xjaxios.get(`facility/queryList`);
  // },
  getfacilityList() {
    return xjaxios.post(`facility/queryByCondition`, { organizationNo: sessionStorage.organizationNo, facilityStatus: 1 });
  },
  getAgriculturalWorkList(params) {
    return xjoaxios.post(`agriculturalWorkType/queryByCondition`, params);
  },
  // getallinpjuttype() {
  //   return xjaxios.post('/facility/queryByCondition', {
  //     condition:	`[{'paramName': 'farmingTypeNo','value': 1,'sign': 'equal'},{'paramName': 'farmId','value':${sessionStorage.organizationNo},'sign': 'equal'}]`
  //   });
  // },
  /**
   * @description: 名称查数据
   * @param {Object} params *
   * @return {Object}
   */
  seachInfo(params) {
    return xjaxios.post("/farmingTask/queryPageList", {
      page: params.page,
      size: params.size,
      total: params.total,
      condition: `[{'paramName':'farmId','value':'${sessionStorage.organizationNo}','sign':'='},{'paramName':'handleStatus','value':true,'sign':'equal'},{'paramName':'farmingTaskName','value':${params.farmingTaskName},'sign':'like'}]"]`
    });
  }
};
